﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<NerdDinner.Helpers.PaginatedList<NerdDinner.Models.Dinner>>" %>
<%@ Import Namespace="NerdDinner.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	   Upcoming Dinners
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

     <h2>
        Upcoming Dinners</h2>
    <ul>
        <%
            foreach (Dinner dinner in Model)
            {%>
        <li>
            <%:Html.ActionLink(dinner.Title, "Details", new {id = dinner.DinnerID})%>
            on
            <%:dinner.EventDate.ToShortDateString()%>
            @
            <%:dinner.EventDate.ToShortTimeString()%>
        </li>
        <%
            }%>
    </ul>
    <%
            if (Model.HasPreviousPage)
            {%>
    <%:Html.RouteLink("<<<",
                                                 "UpcomingDinners",
                                                 new {page = (Model.PageIndex - 1)})%>
    <%
            }%>
    <%
            if (Model.HasNextPage)
            {%>
    <%:Html.RouteLink(">>>",
                                                 "UpcomingDinners",
                                                 new {page = (Model.PageIndex + 1)})%>
    <%
            }%>


</asp:Content>
